<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page import="cn.fl.framework.base.context.CurrentThreadContext" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目产品详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
  <div>
  <input id="prdmarks" value="" style="display:none"/>
<div id="pageInTab" class="pageInTab">
   	 	<form id="basePrdForm1">
    	<div tabid="tabA" title="产品基本信息" lselected="true">
       			<div class="fieldset1 tabel_col clearFix">
       			  <div class="caption">
                                <span class="title">主车配置</span>
                    </div>
               		 <div style="display: none">
               		 	<input name="mfrId" id="mfrId" type="hidden"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="brCd" id="brCd" type="text"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="prdbscInfoId" id="prdbscInfoId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="carId" id="carId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="tkId" id="tkId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdId" id="prdId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdDtlId" id="prdDtlId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
                	 	<input name="removeFlag" id="removeFlag"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">

               		 </div>
               		 		<div class="fieldBox col_33" >
	                        	<div class="label">产品名称</div>
				                <div class="field">
				                	<input name="prdNm"  id="prdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                </div>
				           </div>
				           	<div class="fieldBox col_33" >
	                        	<div class="label">产品类型</div>
				                <div class="field">
				                	<input name="prdTypCdNm" id="prdTypCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                	<input name="prdTypCd" id="prdTypCd" type="hidden"  value=""  class="ui-textbox"  >
				                	<input name="prdCd" id="prdCd" type="hidden"  value=""  class="ui-textbox"  >
				                </div>
				           </div>

				            	<div class="fieldBox col_33" >
	                        	<div class="label">车辆型号</div>
				                <div class="field">
				                	<input name="prdMdl" id="prdMdl" type="text"  value=""  class="ui-textbox">
				                </div>
				           	</div>

				           	<div class="fieldBox col_33" id="isTk">
	                        	<div class="label">车型</div>
				                <div class="field">
				                	<input name="prdMdlSun" id="prdMdlSun" type="text"  value=""  class="ui-textbox" readonly="readonly">
				                </div>
				           	</div>

                  		<div class="fieldBox col_33" >
	                        	<div class="label">产品品牌</div>
				                <div class="field">
				                	<input name="brCdNm" id="brCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                </div>
				           </div>
				           <div class="fieldBox col_33" >
	                        	<div class="label">车系名称</div>
				                <div class="field">
				                	<input name="modelNm" id="modelNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                </div>
				           </div>
				   <div id="tkOption"  style="display: none">
                         <div class="fieldBox col_33">
                                <div class="label">品牌类别</div>
                                <div class="field">
                                 <select id="brTypCd" name="brTypCd">
			                    	<c:forEach items="${brTypCdList}" var="brType">
			                    		<option value="${brType.key }">${brType.value }</option>
			                    	</c:forEach>
                  				  </select>
                                </div>
                            </div>
	                   <div class="fieldBox col_33" id="buyWayCdText">
	                   		 <div class="label"> 保险购买方式：</div>
	                   		 <div class="field">
	                   		 		<select id="buyWayCd" name="buyWayCd">
			                    	<c:forEach items="${buyWayCdList}" var="buyWay">
			                    		<option value="${buyWay.key }">${buyWay.value }</option>
			                    	</c:forEach>
                  				  </select>
	                    	</div>
	                  </div>
                </div>
                 <div class="fieldBox col_33"  id="licenseCdDiv"  style="display: none">
                     <div class="label">牌照类别</div>
                     <div class="field">
                      <select id="licenseCd" name="licenseCd">
		            	<c:forEach items="${licenseCdList}" var="license">
		            		<option value="${license.key }">${license.value }</option>
		            	</c:forEach>
       				  </select>
       				    <span class="requiredSymbol"  id="licenseCdTxt" style="display: none">*</span>
                  </div>
                </div>
				              <div class="fieldBox col_33" >
	                        	<div class="label">厂商名称</div>
				                <div class="field">
				                	<input name="mfrNm" id="mfrNm"  type="text"  value=""   class="ui-textbox"  >
				                </div>
				            </div>
				            <jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddDynamicPage.jsp"></jsp:include>
				            	<div class="fieldBox col_33">
				                    <div class="label">是否新产品</div>
				                    <div class="field">
				                    	 <select id="isNew" name="isNew" onchange="setUsedPdShow()">
							                    	<c:forEach items="${yesNoCdList}" var="yesFlag">
							                    		<option value="${yesFlag.key }">${yesFlag.value }</option>
							                    	</c:forEach>
				                  		</select>
				                    </div>
				                </div>
				                   <div  id="usedPdDiv" class="fieldBox col_33" style="display:none">
				                    <div class="label">车辆已使用期限</div>
				                    <div class="field">
				                    	<select  id="secUsedPd" name="secUsedPd" >
				                    		<option value="0" selected="selected">0个月</option>
				                    	</select>
				                    </div>
				                </div>
				                <!-- 二手设备附加项 -->
		                <div class="fieldBox col_100">
		                <span style="color: red; display: none" id="SecondPrdText" >二手设备附加项</span>
		                </div>
		                <div id="SecondPrd"  style="display: none">
		                 <jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddSecDynamicPage.jsp"></jsp:include>
		                 </div>
				          <div class="caption" >
                                <span class="title">上装配置</span>
                   		  </div>
			                <jsp:include page="../prjprdbscinfo/projectPrdDetailDynamicPage.jsp"></jsp:include>
				             <div class="caption">
                                <span class="title">项目相关信息</span>
                   		  </div>

                        <div class="fieldBox col_33">
                    <div class="label">参考价（元）</div>
                    <div class="field">
                        <input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}"/>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                    <div class="fieldBox col_33">
                    <div class="label">数量</div>
                    <div class="field">
                        <input id="prdQty" name="prdQty" type="text"  class="ui-textbox"  value="" onchange="guidePcChange()" validate="{number: true,required:true}"/>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                  <div class="fieldBox col_33">
                    <div class="label">设备款合计（元）</div>
                    <div class="field">
                        <input id="prdAmt" name="prdAmt" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
                    </div>
                </div>
                   <div class="fieldBox col_33">
                    <div class="label">每台设备留购价（元）</div>
                    <div class="field">
                        <input id="rsrvPc" name="rsrvPc" type="text"  onblur="checkAmt();"   class="ui-textbox"  value="" validate="{number: true,required:true}"/>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_33" id="irrPctText">
                    <div class="label">实际收益率</div>
                    <div class="field">
                        <input id="irrPct" name="irrPct" type="text"  class="ui-textbox"  value="" validate="{number: true}"/>%
                    </div>
                </div>
                <!--    <div class="fieldBox col_33">
                    <div class="label">小计</div>
                    <div class="field">
                        <span id="total" name="total"    class="ui-textbox"  value=""></span>
                    </div>
                </div> -->
                    <!--      <div class="fieldBox col_33">
                                <div class="label">登记证书日期</div>
                                <div class="field">
                              		<input name="certDt" id="certDt" type="text"  class="ui-datepicker"   onblur="setUsedPd()" value="" >
                                </div>
                            </div>
	                    <div class="fieldBox col_33">
	                   		 <div class="label"> 发票金额(元)：</div>
	                   		 <div class="field">
	                       		 <input id="invAmt" name="invAmt" type="text"  class="ui-textbox"  onblur="setSecAmt()"  value="" validate="{number: true}"/>
	                    	</div>
	                  </div>
	                   <div class="fieldBox col_33">
	                   		 <div class="label"> 使用期限(月)：</div>
	                   		 <div class="field">
	                       		 <input id="secUsedPd" name="secUsedPd" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
	                    	</div>
	                  </div>
	                   <div class="fieldBox col_33">
	                   		 <div class="label">折旧系数：</div>
	                   		 <div class="field">
	                       		 <input id="deprRate" name="deprRate" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
	                    	</div>
	                  </div>
	                   <div class="fieldBox col_33">
	                   		 <div class="label"> 应折旧后金额(元)：</div>
	                   		 <div class="field">
	                       		 <input id="deprAmt" name="deprAmt" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
	                    	</div>
	                  </div> -->
               <div class="fieldBox col_50">
                    <div class="label">供应商</div>
                    <div class="field">
                        <input name="splId"  id="splId"  type="text"  value="" placeholder="请选择"   onchange="getSplAccNos();"  ltype="combobox"  validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                         <span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                <!-- 供应商ID -->
                 <div class="fieldBox col_50" >
                    <div class="label">供应商账号</div>
                    <div class="field">
                    	 <!--   <select id="splAccNoId" name="splAccNoId" validate="{required:true}">
                  		  </select> -->
                  		   <input name="splAccNoId"  id="splAccNoId"  type="text"  value="" placeholder="请选择"  onclick="getSplBankNo();"  ltype="combobox"  validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                         <span id="addBtnSplAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                 	<div class="fieldBox col_33" id="isHaveBckNo" style="display: none">
	                    <div class="label">是否有返利账号</div>
	                    <div class="field">
	                    	 <select id="isBckNo" name="isBckNo" onchange="setSplBackBankShow()">
	                    	             <option value="">--请选择--</option>
				                    	<c:forEach items="${yesNoCdList}" var="yesFlag">
				                    		<option value="${yesFlag.key }"
				                    		<c:if test="${hasSplBackNo==yesFlag.key}">
				                    		selected="selected"
				                    		</c:if>
				                    		>${yesFlag.value }</option>
				                    	</c:forEach>
	                  		</select>
	                    </div>
	                </div>
                   <!-- 供应商返利ID -->
                 <div class="fieldBox col_50"  id="splBckBankAccDiv"  style="display: none">
                    <div class="label">供应商返利账号</div>
                    <div class="field">
                    	 <!--   <select id="splAccNoId" name="splAccNoId" validate="{required:true}">
                  		  </select> -->
                  		   <input name="splBackBankNoId"  id="splBackBankNoId"  type="text"  value="" placeholder="请选择"  onclick="getSplBackBankNo();"  ltype="combobox"  >
                         <span class="requiredSymbol" id="splBackBankValidate" style="display: none">*</span>
                         <span id="addBtnSplBankAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                      <!-- 供应商厂商信息 -->
                 <div class="fieldBox col_50"  id="splMfrDiv"  style="display: none">
                    <div class="label">供应商厂商信息</div>
                    <div class="field">
                  		 <input name="splMfrId"  id="splMfrId"  type="text"  value="" placeholder="请选择"  onclick="getSplMfrInfo();"  ltype="combobox"  >
                         <span class="requiredSymbol" id="splMfrInfoValidate" style="display: none">*</span>
                    </div>
                </div>

                </div>
	</div>
   </form>

	 <div id="btnsBox" class="btnsBox">
			<span id="saveBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
	 </div>
	 </form>
</div>
</div>
</div>


<script type="text/javascript">
var prjId="${prjId}";
var prdDetailId="${prdDetailId}";
var _prdCd ='${prdCd}';
var detailFlag = '${detailFlag}';
var splBanNo = '${splBanNo}';
var id="${id}";
var beforePrdQty = '';
var beforeGuidePc = '';
var beforeRsrvPc = '';
var searchSplNm = '';
var bizCd = "${bizCd}";
var buOrgCd = '${buOrgCd}';
var prjTypCd = '${prjTypCd}';//项目类型
var insCode = '${insCode}';//机构代码
var hasSplBackNo = ${hasSplBackNo};
var _rcCstBscInfoId = '';
var plcyTcode = '${plcyTcode}';
var prdTypCd = '${prdTypCd}';
var isSplMfr = '${isSplMfr}';
/*  var wait_dialog_refresh_field = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" }); */
$(function () {
	 var basePrdForm1 = liger.get("basePrdForm1");
	var form = $("#basePrdForm1").ligerForm({
		validate: true
    });
	 $("#basePrdForm1").check_ligerFormEditor();
			initData();
			if(bizCd == "008001" || bizCd == "008004"){
				if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
					liger.get("carLen").setDisabled(true);
				}
				if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
					liger.get("powerTypCd").setDisabled(true);
				}
			}

			//设置影响产品价格的字段为不可修改
			/* if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
				liger.get("prdMdl").setDisabled(true);
			} */
			if(liger.get("emiStdCd")&&liger.get("emiStdCd")!="undefined"){
				liger.get("emiStdCd").setDisabled(true);
			}
			if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
				liger.get("prdClsCd").setDisabled(true);
			}
			if(liger.get("drvTyp")&&liger.get("drvTyp")!="undefined"){
				liger.get("drvTyp").setDisabled(true);
			}
			if(liger.get("engMdl")&&liger.get("engMdl")!="undefined"){
				liger.get("engMdl").setDisabled(true);
			}

			if(liger.get("prdLvlCd")&&liger.get("prdLvlCd")!="undefined"){
				liger.get("prdLvlCd").setDisabled(true);
			}
			if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_CAR){
				//汽车金融事业部隐藏保险购买方式、实际收益率
				   $("#irrPctText").hide();
				   $("#buyWayCdText").hide();
			}else{
				$("#irrPctText").show();
				$("#buyWayCdText").show();
			}
	if(detailFlag=="true"){
			$("#saveBtn").hide();
			$("#cancelBtn").hide();
			$("#addBtnSpl").hide();
			$("#addBtnSplAccNo").hide();
			$("#addBtnSplBankAccNo").hide();

			if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
				liger.get("prdMdl").setDisabled(true);
			}
			if(liger.get("prdNm")&&liger.get("prdNm")!="undefined"){
				liger.get("prdNm").setDisabled(true);
			}
			if(liger.get("prdTypCdNm")&&liger.get("prdTypCdNm")!="undefined"){
				liger.get("prdTypCdNm").setDisabled(true);
			}
			if(liger.get("brCdNm")&&liger.get("brCdNm")!="undefined"){
				liger.get("brCdNm").setDisabled(true);
			}
			if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
				liger.get("buyWayCd").setDisabled(true);
			}
			if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
				liger.get("splMfrId").setDisabled(true);
			}
			if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
				liger.get("splAccNoId").setDisabled(true);
			}
			if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
				liger.get("splBackBankNoId").setDisabled(true);
			}
			if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
				liger.get("isBckNo").setDisabled(true);
			}

				if(liger.get("guidePc")&&liger.get("brCdNm")!="undefined"){
					liger.get("guidePc").setDisabled(true);
				}
				if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
					liger.get("mfrNm").setDisabled(true);
				}

				if($("#prdRem")&&$("#prdRem")!="undefined"){
					$("#prdRem").setDisabled_ligerTextarea(true);
				}

				if($("#mOthInfo")&&$("#mOthInfo")!="undefined"){
					$("#mOthInfo").setDisabled_ligerTextarea(true);
				}

				if(liger.get("prdAmt")&&liger.get("prdAmt")!="undefined"){
					liger.get("prdAmt").setDisabled(true);
				}
				if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
					liger.get("isNew").setDisabled(true);
				}

				if(liger.get("fuelTypCd")&&liger.get("fuelTypCd")!="undefined"){
					liger.get("fuelTypCd").setDisabled(true);
				}
				if(liger.get("rsrvPc")&&liger.get("rsrvPc")!="undefined"){
			 		liger.get("rsrvPc").setDisabled(true);
				}
				if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					var qty = liger.get("prdQty");
					qty.setDisabled(true);
				}

				if(liger.get("irrPct")&&liger.get("irrPct")!="undefined"){
					liger.get("irrPct").setDisabled(true);
				}

				if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
					liger.get("deprRate").setDisabled(true);
				}

				if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
					liger.get("deprAmt").setDisabled(true);
				}
				if(liger.get("certDt")&&liger.get("certDt")!="undefined"){
					liger.get("certDt").setDisabled(true);
				}
				if(liger.get("invAmt")&&liger.get("invAmt")!="undefined"){
					liger.get("invAmt").setDisabled(true);
				}
				if(liger.get("vehCheckCode")&&liger.get("vehCheckCode")!="undefined"){
					liger.get("vehCheckCode").setDisabled(true);
				}


				if(liger.get("secUsedPd")&&liger.get("secUsedPd")!="undefined"){
					liger.get("secUsedPd").setDisabled(true);
				}
				if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
					liger.get("deprRate").setDisabled(true);
				}

				if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
					liger.get("deprAmt").setDisabled(true);
				}
				if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
					liger.get("mfrNm").setDisabled(true);
				}

			 	if($("#prdRem")&&$("#prdRem")!="undefined"){
				$("#prdRem").setDisabled_ligerTextarea(true);
					}

			/* 	if(liger.get("prdLnkComp")){
					liger.get("prdLnkComp").setDisabled(true);
					} */
				if(liger.get("splId")&&liger.get("splId")!="undefined"){
					liger.get("splId").setDisabled(true);
					}
			/* 	if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
					liger.get("isNew").setDisabled(true);
				} */

				/* 	if(liger.get("prdUntCd")){
						liger.get("prdUntCd").setDisabled(true);
					} */

					if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
						liger.get("buyWayCd").setDisabled(true);
					}


					if(liger.get("brTypCd")&&liger.get("brTypCd")!="undefined"){
						liger.get("brTypCd").setDisabled(true);
					}

					if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
						liger.get("prdQty").setDisabled(true);
					}
					//新能源
					if(liger.get("seatRowCd")&&liger.get("seatRowCd")!="undefined"){
						liger.get("seatRowCd").setDisabled(true);
					}
					if(liger.get("carVol")&&liger.get("carVol")!="undefined"){
						liger.get("carVol").setDisabled(true);
					}
					if(liger.get("extMil")&&liger.get("extMil")!="undefined"){
						liger.get("extMil").setDisabled(true);
					}
					if(liger.get("batDeg")&&liger.get("batDeg")!="undefined"){
						liger.get("batDeg").setDisabled(true);
					}
	}

	  if(detailFlag=="true"){

		  if(liger.get("mWhlSpec")&&liger.get("mWhlSpec")!="undefined"){
				liger.get("mWhlSpec").setDisabled(true);
			}
		  if(liger.get("thickness")&&liger.get("thickness")!="undefined"){
				liger.get("thickness").setDisabled(true);
			}

		  if(liger.get("grboxMdl")&&liger.get("grboxMdl")!="undefined"){
				liger.get("grboxMdl").setDisabled(true);
			}
	 	if(liger.get("actCntrSz")&&liger.get("actCntrSz")!="undefined"){
			liger.get("actCntrSz").setDisabled(true);
		}
		if($("#othInfo")&&$("#othInfo")!="undefined"){
			$("#othInfo").setDisabled_ligerTextarea(true);
		}
		if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
			liger.get("liftWayCd").setDisabled(true);
		}
		if(liger.get("doorInfo")&&liger.get("doorInfo")!="undefined"){
			liger.get("doorInfo").setDisabled(true);
		}
		if(liger.get("cylSepc")&&liger.get("cylSepc")!="undefined"){
			liger.get("cylSepc").setDisabled(true);
		}
		if(liger.get("tankVol")&&liger.get("tankVol")!="undefined"){
			liger.get("tankVol").setDisabled(true);
		}
		if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
			liger.get("trlWhlSpec").setDisabled(true);
		}
		if(liger.get("axleInfo")&&liger.get("axleInfo")!="undefined"){
			liger.get("axleInfo").setDisabled(true);
		}
		if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
			liger.get("matQalCd").setDisabled(true);
		}

		if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
			liger.get("matQalCd").setDisabled(true);
		}
		if(liger.get("isHvWhl")&&liger.get("isHvWhl")!="undefined"){
			liger.get("isHvWhl").setDisabled(true);
		}
		if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
			liger.get("trlWhlSpec").setDisabled(true);
		}
		if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
			liger.get("liftWayCd").setDisabled(true);
		}
		if(liger.get("isHvSub")&&liger.get("isHvSub")!="undefined"){
			liger.get("isHvSub").setDisabled(true);
		}

	}

	  if(detailFlag=="true"){

		if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
			liger.get("prdClsCd").setDisabled(true);
		}


		if(liger.get("cabSpec")&&liger.get("cabSpec")!="undefined"){
			liger.get("cabSpec").setDisabled(true);
		}

		if(liger.get("rearAxleSpec")&&liger.get("rearAxleSpec")!="undefined"){
			liger.get("rearAxleSpec").setDisabled(true);
		}
		if(liger.get("cntrSz")){
			liger.get("cntrSz").setDisabled(true);
		}
		if(liger.get("emiStd")){
			liger.get("emiStd").setDisabled(true);
		}
		/* if(liger.get("prdSeries")&&liger.get("prdSeries")!="undefined"){
			liger.get("prdSeries").setDisabled(true);
		} */
		if(liger.get("carMdl")&&liger.get("carMdl")!="undefined"){
			liger.get("carMdl").setDisabled(true);
		}
		if(liger.get("outVol")&&liger.get("outVol")!="undefined"){
			liger.get("outVol").setDisabled(true);
		}
		if(liger.get("grboxCfg")&&liger.get("grboxCfg")!="undefined"){
			liger.get("grboxCfg").setDisabled(true);
		}
		if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
			liger.get("carEngMdl").setDisabled(true);
		}

		if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
			liger.get("carCl").setDisabled(true);
		}
		if(liger.get("maxSpd")&&liger.get("maxSpd")!="undefined"){
			liger.get("maxSpd").setDisabled(true);
		}
		if($("#othCfg")&&$("#othCfg")!="undefined"){
			$("#othCfg").setDisabled_ligerTextarea(true);
		}
		if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
			liger.get("carLen").setDisabled(true);
		}
		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
			liger.get("drvTypCd").setDisabled(true);
		}
		if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
			liger.get("carEngMdl").setDisabled(true);
		}
		if(liger.get("hp")&&liger.get("hp")!="undefined"){
			liger.get("hp").setDisabled(true);
		}
		if(liger.get("prdYr")&&liger.get("prdYr")!="undefined"){
			liger.get("prdYr").setDisabled(true);
		}
		if(liger.get("prdCyCd")&&liger.get("prdCyCd")!="undefined"){
			liger.get("prdCyCd").setDisabled(true);
		}
		if(liger.get("grboxTypCd")&&liger.get("grboxTypCd")!="undefined"){
			liger.get("grboxTypCd").setDisabled(true);
		}
		if(liger.get("seatQtyCd")&&liger.get("seatQtyCd")!="undefined"){
			liger.get("seatQtyCd").setDisabled(true);
		}
		if(liger.get("carStrcCd")&&liger.get("carStrcCd")!="undefined"){
			liger.get("carStrcCd").setDisabled(true);
		}
		if(liger.get("prdWayCd")&&liger.get("prdWayCd")!="undefined"){
			liger.get("prdWayCd").setDisabled(true);
		}
		if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
			liger.get("powerTypCd").setDisabled(true);
		}

		if(liger.get("carStrcCfg")&&liger.get("carStrcCfg")!="undefined"){
			liger.get("carStrcCfg").setDisabled(true);
		}

	}

/* 	 if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_CPYW&&buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
		 $("#splBckBankAccDiv").show();
		 $("#splBackBankValidate").show();
		 //$("#splBackBankNoId").attr("validate","{required:true}");
	 } */
	// if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
		 $("#isHaveBckNo").show();
		 if(hasSplBackNo==1){
			 $("#splBckBankAccDiv").show();
		 }
//	 }

	 if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK&&((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW && isSplMfr == '1')||(prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW && isSplMfr == '1'))){
		 $("#splMfrDiv").show();
		 $("#splMfrInfoValidate").attr("validate","{required:true}");
	 }
	  if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW){
		  $("#licenseCdDiv").show();
		 $("#licenseCdTxt").show();
		 $("#licenseCd").attr("validate","{required:true}");
	  }else{
		  $("#licenseCdDiv").hide();
			 $("#licenseCdTxt").hide();
			 $("#licenseCd").attr("validate","");
	  }
   if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0002||plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011){
		 $("#drvTypCd").attr("validate","{required:true}");
			var html = '<span class="requiredSymbol" id="drvTypCdReq">*</span>';
			$("#drvTypCd").parent().append(html);
	 }else{
		 $("#drvTypCd").attr("validate","");
     	$("#drvTypCdReq").hide();
	 }
	   $("#drvTypCd").change(function () {
           var drvTyp = $(this).val();
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
        	 $("#hp").attr("validate","{required:true}");
        	 var hpReq = $("#hpReq").text();
        	 if(!hpReq){
        	 var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
 			$("#hp").parent().append(hpHtml);
        	 }else{
        		 $("#hpReq").show();
        	 }
        }else{
        	 $("#hp").attr("validate","");
        	$("#hpReq").hide();
        }
       });

/* 		if($("#fuelTypeCd")&&prjTypCd!=ProjectConstant.CODE_PRJ_TYP_CD_ESC){

			 var prdForm1 = liger.get("basePrdForm1");
			 prdForm1.setFieldValidate("fuelTypeCd", {
	                required: false
	            });
		} */
})

function addSpl(){
	var prdmarks = $("#prdmarks").val();
        //弹出框校验供应商是否已存在
        $.ligerDialog.SQopen({
            width: 600,
            height:180,
            title : '请填写供应商名称和税务登记号',
            url:'<%=path%>/product/splInfo/toCheckSplPage.do?lxxz='+true+'&prdmarks='+prdmarks,
            buttons: [{
                	text: "确定", type: 'ok', cls: 'l-dialog-btn-ok',
	                onclick: function (item, Dialog) {
	                    if (Dialog.onOk) Dialog.onOk();
	                }
	            }, {
	                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
	                onclick: function (item, Dialog) {
	                    if (Dialog.onCancel) Dialog.onCancel();
	                }
	            }
        	]

        });
	}

function addSplAccNo(){
	var _id = $("#splId_val").val();
	if(!_id)return;
	Add_navTab('PrdSpl_4'+_id,'供应商账号',"<%=path%>/product/splBank/toListPage.do?splId="+_id+"&lxxz="+true);
}

function checkAmt(){
	var purchaseFee = $("#rsrvPc").val();
	console.log("每台设备留购价的金额:" + purchaseFee);
	// 当留购价失去焦点的时候，会校验【当机构为浙银或兴邦的时候，每台设备留购价 字段 必须为0，不为0，报留购价错误】
	// 机构为浙银金租,兴邦租赁
	if(ProjectConstant.PRJ_INS_CODE_ZYFL == insCode || insCode == ProjectConstant.PRJ_INS_CODE_XBFL) {
		if (purchaseFee != 0) {
			top.$.ligerDialog.SQalert({content: "留购价必须为0，请修改", SQ_type: "warning"});
			return false;
		}
	} else {
		var checkRsrvPc;
		var _url ='<%=path%>/project/prjprdbscinfo/checkRsrvPc.do';
		var params = {};
		if(!checkRsrvPc){
			$.ajax({
				type: 'get',
				dataType:'json',
				data:params,
				url: _url,
				success:function(msg){
					if(msg.success == 1){
						checkRsrvPc = msg.data;
						if(checkRsrvPc){
							checkRsrvPc = checkRsrvPc/100;
							var rsrvPc = $("#rsrvPc").val();
							if(rsrvPc<checkRsrvPc){
								top.$.ligerDialog.SQalert({content: "留购价不能小于100",SQ_type: "error"});
							}
						}
					}else{
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					}
				}
			});
		}
	}
}
//根据选择的供应商信息获取供应商账号信息
<%-- function showSplAccNo(){
	 $("#splAccNoId").html(' ');
	var splId =liger.get("splId").selectedValue;
	var audStsCd=FlowConstant.FLOW_CHECK_STATE_PASS;
	var html = "<option value=''>--请选择--</option>";
		//查询账号信息
		   if(splId){
				var _url ='<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do';
			   	var params = {};
			   	params.splId=splId;
			   	params.audStsCd = audStsCd;
			   	$.ajax({
			   		type: 'get',
			   		dataType:'json',
			   		data:params,
			   		url: _url,
			   		success:function(msg){
			   			 if(msg.success == 1){
			   				 var splBankNOList = msg.data;
			   				 if(splBankNOList){
			   					 for(var i=0;i<splBankNOList.length;i++){
			   						 var bankNo = splBankNOList[i];
			   						html += "<option value='"+bankNo.id+"'>"+bankNo.accNo+"</option>";
			   					 }
			   				 }

			   			 }
			   			 $(html).appendTo('#splAccNoId');
			   	         liger.get("splAccNoId").setSelect();
			   	        liger.get("splAccNoId").setValue(splBanNo);
	   					$("#splAccNoIdDiv").show();
			   		}
			   	});
	}

}
 --%>

 var audStsCdList = new Array();
	//audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
		if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
	audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
	var audStsCdListArr = JSON.stringify(audStsCdList);
	//设置折旧后金额
	function setSecAmt(){
	 	var invAmt = $("#invAmt").val();
	 	var secRate =  $("#deprRate").val();
	 	var discountAmt = 0;
	 	if(invAmt&&secRate){
	 		discountAmt = parseFloat(invAmt)*parseFloat(secRate);
	 	}
	 	$("#deprAmt").val(discountAmt);

	 }

	function initData(){
		//默认数量为1
		var prdQty = $("#prdQty").val();
		if(prdQty==""){
			$("#prdQty").val("1");
		}
		if(insCode==ProjectConstant.PRJ_INS_CODE_ICBC){
			$("#rsrvPc").removeAttr("onblur");
			$("#rsrvPc").val(0);
			$("#prdQty").val("1");
			//数量为1不可修改
			/*if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
				liger.get("prdQty").setDisabled(true);
			}*/
			//添加提示
		/* 	var  mOthInfo = $("#mOthInfo");
			if($("#mOthInfo")){
				var html = '<span style="color: red">请按照以下规则维护备注信息：<br/>合同号：**********，上装分期：*期、月供：*元；或此项目已包含上装部分报价</span>';
			$("#mOthInfo").before(html);
			} */
		}
		var rsrvPc = $("#rsrvPc").val();
		if(rsrvPc==""){
			$("#rsrvPc").val("100");
		}


		   if(!liger.get("certDt")){
			   //没有二手车信息，默认是新车，是否新车不可修改
			liger.get("isNew").setDisabled(true);
		   }
		 if(!id){
	 	 var isNew = $("#isNew").val();
			if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_ESC){
				  liger.get("isNew").setValue("0");
				//$("#isNew").val("0");
				//设置不可选
				 var slt=liger.get("isNew");
	             slt.setDisabled(true);
			}else{
				if(isNew=='1'){
					//默认不可选
					 var slt=liger.get("secUsedPd");
			             slt.setDisabled(true);
				}
			}
		 }




		var _bizTypCd = '${bizTypCd}';
		//var _bizCd = '${bizCd}';
		var _prdTypCdNm = '${prdTypCdNm}';
		var prdBscInfo = '${prdBscInfoVO}';
		var tkFlag ='${tkFlag}';
		var modifyFlag ='${modifyFlag}';
		if(modifyFlag){
			getDataByDetailId(prdDetailId);
		}else{
		setDataByPrdTypeAndDetailId(_prdCd,prdDetailId);
		}
		if(tkFlag){
			$("#lnkComp").show();
			$("#tkOption").show();
		}
		setUsePdOption();//设置已用月份option
		var guidePc = $("#guidePc").val();
    	var prdQty = $("#prdQty").val();
		if(guidePc&&prdQty){
		    //设置小计值
			guidePcChange();
		}
    }
    //设置小计值
    function guidePcChange(){
    	var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
    	var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
    	 var total =0;
    	if(guidePc&&prdQty){
	     total = NumberUtils.mul(guidePc,prdQty);
    	}
	    $("#total").text(total);
	    $("#prdAmt").val(total);
    }
    //设置可选
   function setUsedPdShow(){

    	var prdmarks = $("#prdmarks").val();
    	var isNew = $("#isNew").val();
    	if(isNew=='0'){
    		 $("#SecondPrd").show();
    		 if(prdmarks!="car"){
    			 $("#SecondPrdText").show();
    		 }
    		 setUsePdOption();
    		 var usedPd=liger.get("secUsedPd");
    		 if(usedPd){
    			 if(detailFlag!="true"){
    		 	 usedPd.setEnabled(true);
    			 }else{
    				 usedPd.setDisabled(true);
    			 }
    		 }
    		 if(prdmarks!="car"){
    			 setSecAmt();
    		 }
    	}
    	if(isNew=='1'){
    		 $("#SecondPrd").hide();
    		 $("#SecondPrdText").hide();
    		  var usedPd=liger.get("secUsedPd");
    		  setUsePdOption();
    		  if(usedPd){
    			   liger.get("secUsedPd").setValue(0);
    		      usedPd.setDisabled(true);
    		  }
    	}
    }
    //设置可选
   function setUsedPd(){
	   var certDt = liger.get("certDt").getValue();
	   if(certDt){
	   var date = new Date(certDt);
	   var month=date.getMonth()+1;
	   var currMonth = (new Date()).getMonth()+1;
	   var year = date.getYear();
	   var currYear = (new Date()).getYear();
	   var diffMonth =(currYear-year)*12+ currMonth-month+1;
	   liger.get("secUsedPd").setValue(diffMonth);

	//   var secUsedPd = $("#secUsedPd").val(diffMonth+"");
	   //设置usedPd值，并设为不可选
	    var usedPd=liger.get("usedPd");
		  if(usedPd){
			  liger.get("usedPd").setValue(diffMonth);
		      usedPd.setDisabled(true);
		  }
		  //设置折旧率
			var _url ='<%=path%>/project/prjbscinfo/getDiscountRate.do';
		   	var params = {};
		   	params.month=diffMonth;
		   	$.ajax({
		   		type: 'get',
		   		dataType:'json',
		   		data:params,
		   		url: _url,
		   		success:function(msg){
		   			 if(msg.success == 1){
		   				 $("#deprRate").val(msg.data);
		   			 }else{
		   				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
		   			 }
		   		}
		   	});

	   }
   }

   function getDataByDetailId(prdDetailId){
		var _url ='<%=path%>/project/prjprdbscinfo/getDataByDetailId.do';
   	var params = {};
   	params.id=prdDetailId;
   	if(!prdDetailId)return;
   	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:params,
   		url: _url,
   		success:function(msg){
   			 if(msg.success == 1){
   				setPrjPrdBscInfo(msg.data);//设置数据
   		<%--
   			  var comboGrid_defaultValue1='${splId}';
   		     var comboGrid_defaultText1 = '${splNm}';
   		     var isInit_setSearchComboVal1 = false;
   		  //供应商
      		  liger.get("splNm").setValue(searchSplNm);
   		    var COMBO_SPL = $("#splId").ligerComboBox({
   		        width: 400,
   		        selectBoxWidth: 380,
   		        selectBoxHeight: 240,
   		        valueField: 'id',
   		        textField: 'splNm',
   		        isMultiSelect: true,
   		        isSingleCheck: true,
   		        grid: getSplGridOptions(true),
   		        condition: {
   		            labelWidth: 0,
   		            space: 5,
   		            fields: [{ name: 'splNm', width: 90, type:'text' , keyName: 'id'}]
   		        },
   		    /*     conditionSearchClick: function (a) {
   		            COMBO_MNG.grid.loadData($.ligerFilter.getFilterFunction(a.rules));
   		        }, */
   		        delayLoadGrid: false,
   		        onChangeValue: function (value) {
   		            if (COMBO_SPL) {
   		                if (value=="") comboGrid_defaultValue1 = ""; //如果点击清空'x'，就滞空初始值
   		                $("#splId").show_ligerComboItems(".combo_itemList_wrap");
   		            };
   		            SetIframe_height();
   		        }
   		    });

   		    function getSplGridOptions(checkbox){
   		    	var selectSplNm =  liger.get("splNm").getValue();
   		        var options = {
   		            columns: [
   		                { display: '供应商名称', name: 'splNm', minWidth: 150 },
   		                { display: '企业性质', name: 'corpTypCdNm', minWidth: 100 },
   		                { display: '经营范围', name: 'bizScope', minWidth: 150 },
   		                { display: '注册资本', name: 'regCapAmt', minWidth: 50 },
   		                { display: '实收资本', name: 'paidCapAmt', minWidth: 50 },
   		            ],
   		            switchPageSizeApplyComboBox: false,
   		            url: '<%=path%>/product/splInfo/initList.do?searchflag=prj&&audStsCd='+FlowConstant.FLOW_CHECK_STATE_PASS,
   		        	 params: {condition:[{"op":"like","field":"splNm","value": comboGrid_defaultValue1,"type":"text"}]},
   		            method: 'get',
   		            dataAction: 'local',
   		            root:'rows',
   			        record:'total',
   		            pageSize: 10,
   		            usePagerOnLessPagesize: false,
   		            cssClass: "SMALL_grid",
   		           // checkbox: checkbox,
   		            isSingleCheck: true,
   		            frozen: false,
   		            isSelected: function (rowdata) {
   		                if (comboGrid_defaultValue1 == "") return false;
   		                var defaultItems = comboGrid_defaultValue1.split(";");
   		                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
   		                    for (var i = 0; i < defaultItems.length; i++) {
   		                        if(rowdata[COMBO_SPL.options.valueField] == defaultItems[i]) {
   		                            return true;
   		                        }
   		                    };
   		                };
   		                return false;
   		            },
   		            onAfterShowData: function (currentData) {
   		                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
   		                	COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
   		                    isInit_setSearchComboVal1 = true;
   		                }
   		            }
   		        };
   		        return options;
   		    }

   				 --%>


   			 }else{
   				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
   			 }
   		}
   	});
   }
    function setDataByPrdTypeAndDetailId(_prdCd,prdDetailId){
		var _url ='<%=path%>/project/prjbscinfo/getDataByPrdTypeAndDetailId.do';
    	var params = {};
    	params.prdCd = _prdCd;
    	params.prdTypCd = prdTypCd;
    	params.prdDetailId=prdDetailId;
    	if(!prdDetailId)return;
    	$.ajax({
    		type: 'get',
    		dataType:'json',
    		data:params,
    		url: _url,
    		async:false,
    		success:function(msg){
    			 if(msg.success == 1){
    				 setData(msg.data);//设置数据
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
    }
     var comboGrid_defaultValue1='${splId}';
     var comboGrid_defaultText1 = '${splNm}';
     var isInit_setSearchComboVal1 = false;
    var COMBO_SPL = $("#splId").ligerComboBox({
        width: 300,
        selectBoxWidth: 300,
        selectBoxHeight: 240,
        valueField: 'id',
        textField: 'splNm',
        isMultiSelect: true,
        isSingleCheck: true,
        grid: getSplGridOptions(true),
        parms: {condition:JSON.stringify([{"op":"like","field":"splNm","value": comboGrid_defaultText1,"type":"text"}])},
        condition: {
            labelWidth: 0,
            space: 5,
            fields: [{ name: 'splNm', width: 90, type:'text' , keyName: 'id'}]
        },
    /*     conditionSearchClick: function (a) {
            COMBO_MNG.grid.loadData($.ligerFilter.getFilterFunction(a.rules));
        }, */
        delayLoadGrid: false,
        onChangeValue: function (value) {
            if (COMBO_SPL) {
                if (value=="") comboGrid_defaultValue1 = ""; //如果点击清空'x'，就滞空初始值
                $("#splId").show_ligerComboItems(".combo_itemList_wrap");
            };
            var _selected = this.gridManager.getSelected()
            var rcId = _selected && _selected.rcCstBscInfoId;
            if(typeof(rcId) != "undefined" && rcId!=null){
            	_rcCstBscInfoId = rcId;
            }
            SetIframe_height();
        }
    });
  //供应商
  liger.get("splNm").setValue(searchSplNm);
 	var selectSplNm =  liger.get("splNm").getValue();
    function getSplGridOptions(checkbox){
    	var _prjId = '${prjId}';
        var options = {
            columns: [
                { display: '供应商名称', name: 'splNm',
                	render: function (rowdata, rowindex, value, column) {
	            		 value ==null?"":value;
	            		var h = '';
	            		var audStsCd = rowdata.audStsCd;
	            		if(audStsCd){
	            		  if(audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
		                    	h+='<i class="ico_flasher"></i>';
		                    }
	            		}
	                        h+=value;
	                        return h;
	            	},
                	minWidth: 150 },
                { display: '企业性质', name: 'corpTypCdNm', minWidth: 100 },
                { display: '经营范围', name: 'bizScope', minWidth: 150 },
                { display: '注册资本', name: 'regCapAmt', minWidth: 50 },
                { display: '实收资本', name: 'paidCapAmt', minWidth: 50 },
                { display: '黑名单', name: 'isBlackList',width:1, hide:true},
            ],
            switchPageSizeApplyComboBox: false,
            url: '<%=path%>/project/prjprdbscinfo/splInitList.do?audStsCdList='+audStsCdListArr+'&prjId='+_prjId,
            //parms: {condition:[{"op":"like","field":"splNm","value": comboGrid_defaultValue1,"type":"text"}]},
            method: 'get',
            dataAction: 'local',
            root:'rows',
	        record:'total',
            pageSize: 10,
            usePagerOnLessPagesize: false,
            cssClass: "SMALL_grid",
           // checkbox: checkbox,
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue1 == "") return false;
                var defaultItems = comboGrid_defaultValue1.split(";");
                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_SPL.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
                	COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
                    isInit_setSearchComboVal1 = true;
                }
            },
            onSelectRow:function(rowdata){
				if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
                    if(rowdata){
                        if(rowdata.isBlackList=='1'){
                            $.ligerDialog.error("该挂靠公司列为黑名单，请重新选择");
                            return false;
                        }
                    }
                }

                return true;
            }
        };
        return options;
    }
	function setUsePdOption(){
		var html = "";
		for(var i=1;i<31;i++){
			html+="<option value="+i+">"+i+"个月</option>";
		}
		$("#secUsedPd").append(html);
	}
  function setPrjPrdBscInfo(basePrdInfo){
	  if(basePrdInfo){
			var carInfo = basePrdInfo.prjPrdCarInfoVO; //乘用车明细数据
	    	var tkInfo = basePrdInfo.prjPrdTkInfoVO; //卡车明细数据
	    	 var basePrdForm1 = liger.get("basePrdForm1");
	     	 basePrdForm1.setData({
	    		 prdNm: basePrdInfo.prdNm,
	    		 prdClsCdNm: basePrdInfo.prdClsCdNm,
	    		 prdTypCd: basePrdInfo.prdTypCd,
	    		 prdCd: basePrdInfo.prdCd,
	    		 brCdNm:basePrdInfo.brCdNm,
	    		 brCd: basePrdInfo.brCd,
	    		 prdMdl: basePrdInfo.prdMdl,
	    		 prdMdlSun: basePrdInfo.prdMdlSun,
	    		 mfrId: basePrdInfo.mfrId,
	    		 mfrNm: basePrdInfo.mfrNm,
	    		 prdRem: basePrdInfo.prdRem,
	    		 audStsCd: basePrdInfo.audStsCd,
	    		 prdTypCdNm: basePrdInfo.prdTypCdNm,
	    		 isNew :basePrdInfo.isNew ,
	    		 usedPd :basePrdInfo.usedPd ,
	    		 secUsedPd :basePrdInfo.usedPd ,
	    		 rsrvPc :basePrdInfo.rsrvPc ,
	    		 guidePc :basePrdInfo.guidePc,
	    		 prdQty :basePrdInfo.prdQty ,
	    	/* 	 prdUntCd :basePrdInfo. prdUntCd, */
	    		 prdAmt :basePrdInfo.prdAmt ,
	    		 prdUseCd :basePrdInfo.prdUseCd ,
	    		 prdRem :basePrdInfo.prdRem ,
	    		 irrPct :basePrdInfo.irrPct ,
	    		// prdLnkComp:basePrdInfo.lnkCompRList,
	    		 prdbscInfoId:basePrdInfo.id,
	    		 usedPd:basePrdInfo.usedPd,
	    		 prdAmt:basePrdInfo.prdAmt,
	    		 certDt:basePrdInfo.certDt,
				 invAmt:basePrdInfo.invAmt,
				 splId:basePrdInfo.splId,
				 prdId:basePrdInfo.prdId,
				 guidePc:basePrdInfo.guidePc,
				 splAccNoId:basePrdInfo.splAccNoId,
				 //
				 certDt:basePrdInfo.certDt,
				 invAmt:basePrdInfo.invAmt,
				 deprRate:basePrdInfo.deprRate,
				 deprAmt:basePrdInfo.deprAmt,
				 prdDtlId:basePrdInfo.prdDtlId,
				 modelNm:basePrdInfo.modelNm
	         });
	     	 if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
	     		if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					liger.get("prdQty").setDisabled(true);
				}
	     	 }
	     	 $("#mfrId").val(basePrdInfo.mfrId);
	     	 $("#brCd").val(basePrdInfo.brCd);
	     	 $("#carId").val(basePrdInfo.id);
	     	 $("#tkId").val(basePrdInfo.id);
	     	 $("#isNew").val(basePrdInfo.isNew);
	     	 $("#prdId").val(basePrdInfo.prdId);
	     	 $("#prdDtlId").val(basePrdInfo.prdDtlId);
	    	 $("#prdbscInfoId").val(basePrdInfo.id);
	    	 searchSplNm = basePrdInfo.splNm;
	     	var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
	    	var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
		    var total = NumberUtils.mul(guidePc,prdQty);
		    $("#total").text(total);
		   	    beforePrdQty = prdQty;
		   		beforeGuidePc = guidePc;
		   		beforeRsrvPc = $("#rsrvPc").val();
	     	  basePrdForm1 = liger.get("basePrdForm1");
	      	 if(null!=carInfo){
	      		$("#isTk").hide();
	      		$("#prdmarks").val("car");
	      		liger.get("isNew").setEnabled(true);
	      		if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
	      		if(basePrdInfo.carCl!=null&&basePrdInfo.carCl!=""){
	      			var carClArr= (basePrdInfo.carCl).split(",");
	          		liger.get("carCl").clearContent();
	          		var newOptions='<option value=""></option>';
	    			if(carClArr.length>0){
	    			for(var i=0;i<carClArr.length;i++){
	    				newOptions+='<option value="'+carClArr[i]+'">'+carClArr[i]+'</option>';
	    				}
	    			}
	    			newOptions+='<option value="'+'其他'+'">'+'其他'+'</option>';
	                $("#carCl").html($(newOptions));
	                liger.get("carCl").setSelect();
	      		}else{
	      			$.ajax({
	      				type:'get',
	      				dataType:'json',
	      				data:{},
	      				async:false,
	      				url:'<%=path%>/project/prjbscinfo/getCarClList.do',
	      				success:function(data){
	      						liger.get("carCl").clearContent();
	      		          		var newOptions='<option value=""></option>';
	      		    			if(data.length>0){
	      		    			for(var i=0;i<data.length;i++){
	      		    				newOptions+='<option value="'+data[i].key+'">'+data[i].key+'</option>';
	      		    				}
	      		    			}
	      		                $("#carCl").html($(newOptions));
	      		                liger.get("carCl").setSelect();
	      				},
	      				error:function(data){

	      				}
	      			});
	      		  }
	      		}
	      		if(basePrdInfo.prdTypCd=="016"||basePrdInfo.prdTypCd=="019"|basePrdInfo.prdTypCd=="020"||basePrdInfo.prdTypCd=="008004"){
	            	liger.get("prdMdl").setDisabled(true);
	            }
	      		basePrdForm1.setData({
	     	   	/* prdSeries: carInfo.prdSeries, */
	     	 	 carLen: carInfo.carLen,
	     	 	prdYr: carInfo.prdYr,
	     	 	prdCyCd: carInfo.prdCyCd,
	     	 	outVol: carInfo.outVol,
	     	 	prdMdlSun: carInfo.prdMdl,
	     	 	grboxTypCd: carInfo.grboxTypCd,
	     	 	grboxCfg: carInfo.grboxCfg,
	     	 	seatQtyCd: carInfo.seatQtyCd,
	     	 	engMdl: carInfo.engMdl,
	     	 	drvTypCd: carInfo.drvTypCd,
	     	 	carStrcCd: carInfo.carStrcCd,
	     	 	carStrcCfg: carInfo.carStrcCfg,
	     	 	powerTypCd: carInfo.powerTypCd,
	     	 	carCl: carInfo.carCl,
	     	 	maxSpd: carInfo.maxSpd,
	     	 	prdWayCd: carInfo.prdWayCd,
	     	 	carMdl: carInfo.carMdl,
	     	 	othCfg: carInfo.othCfg,
	     	 	carVol: carInfo.carVol,
	     	 	extMil: carInfo.extMil,
	     	 	batDeg: carInfo.batDeg,
	     	 	emiStdCd:carInfo.emiStdCd,
	     	 	carId:carInfo.id,
	     	 	prdLvlCd:carInfo.prdLvlCd
	            });
	      		 $("#carId").val(carInfo.id);
	     	 }
	      	 basePrdForm1 = liger.get("basePrdForm1");
	     	if(null!=tkInfo){
	     		$("#prdmarks").val("tk");
	     		liger.get("prdMdl").setDisabled(true);
	     		basePrdForm1.setData({
	     	   	prdId: tkInfo.prdId,
	     	   drvTyp: tkInfo.drvTyp,
	     	  engMdl: tkInfo.engMdl,
	     	 hp: tkInfo.hp,
	     	emiStd: tkInfo.emiStd,
	     	cabSpec: tkInfo.cabSpec,
	     	prdMdlSun: tkInfo.prdMdl,
	     	grboxMdl: tkInfo.grboxMdl,
	     	rearAxleSpec: tkInfo.rearAxleSpec,
	     	mWhlSpec: tkInfo.mWhlSpec,
	     	 prdClsCd: tkInfo.prdClsCd,
    		 prdCd: tkInfo.prdCd,
    		 //prdMdl: basePrdInfo.prdMdl,
	     	cntrSz: tkInfo.cntrSz,
	     	actCntrSz: tkInfo.actCntrSz,
	     	thickness: tkInfo.thickness,
	     	axleInfo: tkInfo.axleInfo,
	     	matQalCd: tkInfo.matQalCd,
	     	liftWayCd: tkInfo.liftWayCd,
	     	doorInfo: tkInfo.doorInfo,
	     	isHvWhl: tkInfo.isHvWhl,
	     	trlWhlSpec: tkInfo.trlWhlSpec,
	     	cylSepc: tkInfo.cylSepc,
	     	tankVol: tkInfo.tankVol,
	     	othInfo: tkInfo.othInfo,
	     	tkId:tkInfo.id,
	     	brTypCd:tkInfo.brTypCd,
	     	buyWayCd:tkInfo.buyWayCd,
	     	prdClsCd:tkInfo.prdClsCd,
	     	emiStd:tkInfo.emiStd,
	     	gasCylSpec:tkInfo.gasCylSpec,
	     	saddleSpec:tkInfo.saddleSpec,
	     	isHvAirCnd:tkInfo.isHvAirCnd,
	     	whlBase:tkInfo.whlBase,
	     	isHvSub:tkInfo.isHvSub,
	     	batDeg:tkInfo.batDeg,
	     	seatRowCd:tkInfo.seatRowCd,
	     	clsExfPc:tkInfo.clsExfPc,
	     	mOthInfo:tkInfo.mOthInfo,
	     	fuelTypCd:tkInfo.fuelTypCd
	            });
	     		 $("#tkId").val(tkInfo.id);
	     		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
	     		    liger.get("drvTypCd").setValue(tkInfo.drvTyp);
	     		}
	     	}
	     	  setUsedPdShow();
	     	 setSecAmt();
	  }
  }


    function setData(basePrdInfo){

    	var carInfo = basePrdInfo.prdCarInfoVO; //乘用车明细数据
    	var tkInfo = basePrdInfo.prdTkInfoVO; //卡车明细数据
    	var basePrdForm1 = liger.get("basePrdForm1");
    	if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
     		if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
				liger.get("prdQty").setDisabled(true);
			}
     		basePrdForm1.setData({
     			prdQty: basePrdInfo.ctrValue
     		});
     	 }else{
     		basePrdForm1.setData({
     			prdQty: 1
     		});
     	 }
     	 basePrdForm1.setData({
    		 prdNm: basePrdInfo.prdNm,
    		 prdClsCdNm: basePrdInfo.prdClsCdNm,
    		 prdClsCd: basePrdInfo.prdClsCd,
    		 prdCd: basePrdInfo.prdCd,
    		 prdTypCd: basePrdInfo.prdTypCd,
    		 brCdNm:basePrdInfo.brCdNm,
    		 brCd: basePrdInfo.brCd,
    		 //prdMdl: basePrdInfo.prdMdl,
    		 prdMdlSun:basePrdInfo.prdMdl,
    		 secUsedPd :basePrdInfo.usedPd ,
    		 mfrId: basePrdInfo.mfrId,
    		 mfrNm: basePrdInfo.mfrNm,
    		 //guidePc :basePrdInfo.guidePcDouble,
    		 prdRem: basePrdInfo.prdRem,
    		 audStsCd: basePrdInfo.audStsCd,
    		 prdTypCdNm: basePrdInfo.prdTypCdNm,
    		 prdId:basePrdInfo.id,
    		modelNm:basePrdInfo.modelNm
         });
     	  basePrdForm1 = liger.get("basePrdForm1");
      	 if(null!=carInfo){
      		$("#isTk").hide();
      		$("#prdmarks").val("car");
      		liger.get("isNew").setEnabled(true);
      		if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
      		if(carInfo.carCl!=null&&carInfo.carCl!=""){
      			var carClArr= (carInfo.carCl).split(",");
          		liger.get("carCl").clearContent();
          		var newOptions='<option value=""></option>';
    			if(carClArr.length>0){
    			for(var i=0;i<carClArr.length;i++){
    				newOptions+='<option value="'+carClArr[i]+'">'+carClArr[i]+'</option>';
    				}
    			}
    			newOptions+='<option value="'+'其他'+'">'+'其他'+'</option>';
                $("#carCl").html($(newOptions));
                liger.get("carCl").setSelect();
      		}else{
      			$.ajax({
      				type:'get',
      				dataType:'json',
      				data:{},
      				url:'<%=path%>/project/prjbscinfo/getCarClList.do',
      				success:function(data){
      						liger.get("carCl").clearContent();
      		          		var newOptions='<option value=""></option>';
      		    			if(data.length>0){
      		    			for(var i=0;i<data.length;i++){
      		    				newOptions+='<option value="'+data[i].key+'">'+data[i].key+'</option>';
      		    				}
      		    			}
      		                $("#carCl").html($(newOptions));
      		                liger.get("carCl").setSelect();
      				},
      				error:function(data){

      				}
      			});
      		}

      		}
            var guidePc = (carInfo.guidePc/100).toFixed(2);
            if(basePrdInfo.prdTypCd=="016"||basePrdInfo.prdTypCd=="019"||basePrdInfo.prdTypCd=="020"||basePrdInfo.prdTypCd=="008004"||basePrdInfo.prdTypCd=="008001"){
            	basePrdForm1.setData({
            		prdMdl: basePrdInfo.prdMdl,
            	});
            	liger.get("prdMdl").setDisabled(true);
            }
      		basePrdForm1.setData({
     	   	/* prdSeries: carInfo.prdSeries, */
     	 	 carLen: carInfo.carLen,
     	 	prdYr: carInfo.prdYr,
     	 	prdCyCd: carInfo.prdCyCd,
     	 	outVol: carInfo.outVol,
     	 	grboxTypCd: carInfo.grboxTypCd,
     	 	grboxCfg: carInfo.grboxCfg,
     	 	seatQtyCd: carInfo.seatQtyCd,
     	 	engMdl: carInfo.engMdl,
     	 	drvTypCd: carInfo.drvTypCd,
     	 	carStrcCd: carInfo.carStrcCd,
     	 	carStrcCfg: carInfo.carStrcCfg,
     	 	powerTypCd: carInfo.powerTypCd,
     	 	guidePc :guidePc,
     	 	//carCl: carInfo.carCl,
     	 	maxSpd: carInfo.maxSpd,
     	 	prdWayCd: carInfo.prdWayCd,
     	 	carMdl: carInfo.carMdl,
     	 	othCfg: carInfo.othCfg,
     	 	carVol: carInfo.carVol,
     	 	extMil: carInfo.extMil,
     	 	batDeg: carInfo.batDeg,
     	 	emiStdCd:carInfo.emiStdCd,
     		prdId:carInfo.prdId,
     	 	prdLvlCd:carInfo.prdLvlCd
            });
     	 }
      	 basePrdForm1 = liger.get("basePrdForm1");
     	if(null!=tkInfo){
     		$("#prdmarks").val("tk");
     		liger.get("prdMdl").setDisabled(true);
     		var guidePc = (tkInfo.guidePc/100).toFixed(2);
     		basePrdForm1.setData({
     	   	prdId: tkInfo.prdId,
     	   drvTyp: tkInfo.drvTyp,
     	  engMdl: tkInfo.engMdl,
     	 hp: tkInfo.hp,
     	emiStd: tkInfo.emiStd,
     	cabSpec: tkInfo.cabSpec,
     	grboxMdl: tkInfo.grboxMdl,
     	rearAxleSpec: tkInfo.rearAxleSpec,
     	mWhlSpec: tkInfo.mWhlSpec,
     	guidePc :guidePc,
     	cntrSz: tkInfo.cntrSz,
     	actCntrSz: tkInfo.actCntrSz,
     	thickness: tkInfo.thickness,
     	axleInfo: tkInfo.axleInfo,
     	prdMdl: basePrdInfo.prdMdl,
     	matQalCd: tkInfo.matQalCd,
     	liftWayCd: tkInfo.liftWayCd,
     	doorInfo: tkInfo.doorInfo,
     	isHvWhl: tkInfo.isHvWhl,
     	trlWhlSpec: tkInfo.trlWhlSpec,
     	cylSepc: tkInfo.cylSepc,
     	tankVol: tkInfo.tankVol,
     	othInfo: tkInfo.othInfo,
     	prdId:tkInfo.prdId,

     	gasCylSpec:tkInfo.gasCylSpec,
     	saddleSpec:tkInfo.saddleSpec,
     	isHvAirCnd:tkInfo.isHvAirCnd,
     	whlBase:tkInfo.whlBase,
     	isHvSub:tkInfo.isHvSub,
     	batDeg:tkInfo.batDeg,
     	seatRowCd:tkInfo.seatRowCd,
     	clsExfPc:tkInfo.clsExfPc,
     	mOthInfo:tkInfo.mOthInfo,
     	fuelTypCd:tkInfo.fuelTypCd
            });
     		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
     		    liger.get("drvTypCd").setValue(tkInfo.drvTyp);
     		}
     		var drvTyp = tkInfo.drvTyp;
     	     if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
            	 $("#hp").attr("validate","{required:true}");
            	 var hpReq = $("#hpReq").text();
            	 if(!hpReq){
            	 var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
     			$("#hp").parent().append(hpHtml);
            	 }else{
            		 $("#hpReq").show();
            	 }
            }else{
            	 $("#hp").attr("validate","");
            	$("#hpReq").hide();
            }
     	}

     	$("#prdDtlId").val(prdDetailId);
     	 $("#mfrId").val(basePrdInfo.mfrId);
     	 $("#brCd").val(basePrdInfo.brCd);
     	 $("#prdId").val(basePrdInfo.id);
     	var guidePc = $("#guidePc").val();
    	var prdQty = $("#prdQty").val();
		if(guidePc&&prdQty){
		    //设置小计值
			guidePcChange();
		}

		setUsedPdShow()
    }
  //取消
	function cancelBtn(){
		  var TAB=top.mainApp.parentTab;
          var currentTabid=TAB.getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid);
	}

  function savePrjBscInfo(){
	  var purchaseFee = $("#rsrvPc").val();
	  console.log("保存按钮，每台设备留购价的金额:" + purchaseFee);
	  // 当保存的时候，会校验【当机构为浙银的时候，每台设备留购价 字段 必须为0，不为0，报留购价错误】
	  // 机构为浙银金租
	  if(ProjectConstant.PRJ_INS_CODE_ZYFL == insCode) {
		  if (purchaseFee != 0) {
			  top.$.ligerDialog.SQalert({content: "留购价必须为0，请修改", SQ_type: "warning"});
			  return false;
		  }
	  }

		  var ligerForm = liger.get("basePrdForm1");
		  if (!ligerForm.valid()) {
			  top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			  return false; //验证不通过，不执行以下代码
		  }
		  var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
		  var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
		  var prdbscInfoId = $("#prdbscInfoId").val();
		  var rsrvPc = $("#rsrvPc").val();
		  if(guidePc&&prdQty&&prdbscInfoId&&rsrvPc){
			  if(guidePc!=beforeGuidePc||beforePrdQty!=prdQty||rsrvPc!=beforeRsrvPc){
				  var _ids = [];
				  _ids.push(prdbscInfoId);
				  var params = {};
				  params.prjId=prjId;
				  params.ids = JSON.stringify(_ids);
				  $.ajax({
					  type: 'get',
					  dataType:'json',
					  data:params,
					  url: '<%=path%>/project/prjprdbscinfo/checkPrjPrdDtlExist.do',
					  success:function(msg){
						  if(msg.data==true){
							  $.ligerDialog.SQalert({
								  SQ_showButtons: true,
								  SQ_onBtnclick: function (item, Dialog) {
									  $("#removeFlag").val(CommonConstant.C_YN_Y);
									  save();
								  },
								  content: "已经存在支付表信息，确定删除已经拆分的支付表,修改数量和指导价信息吗？"
							  });

							  /* 		$.ligerDialog.confirm("已经存在支付表信息，确定删除已经拆分的支付表,修改数量和指导价信息吗？", function (flag) {
                                          $("#removeFlag").val(CommonConstant.C_YN_Y);
                                          save();
                                      });	 */
						  }else{
							  $("#removeFlag").val(CommonConstant.C_YN_N);
							  save();
						  }

					  }

				  });
			  }else{
				  $("#removeFlag").val(CommonConstant.C_YN_N);
				  save();
			  }
		  }else{
			  $("#removeFlag").val(CommonConstant.C_YN_N);
			  save();
		  }
  }

	//保存项目基础信息
	function save(){
        var ligerForm = liger.get("basePrdForm1");
         if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }

        var splNm = $("#splId").val();
        var data = ligerForm.getData();
        var prjId = '${prjId}';
        var prdCd = _prdCd;
    	var isNew = $("#isNew").val();
    	var rcCstBscInfoId = _rcCstBscInfoId;
        if(isNew=="1"&&$("#prdbscInfoId").val()){
        	//设置二手车相应的字段为空
        	 data["invAmt"] = 0;
        	 data["certDt"] = null;
        	 data["usedPd"] = 0;
        	 data["deprRate"] = 0;
        	 data["deprAmt"] = 0;
        }
        data["prjId"] = prjId;
        data["prdCd"] = prdCd;
        data["splNm"] = splNm;
        data["carId"] = $("#carId").val();
        data["tkId"] = $("#tkId").val();
        data["mfrId"]=$("#mfrId").val();
        data["prdId"]=$("#prdId").val();
        data["prdDtlId"]=$("#prdDtlId").val();
        data["prdQty"]=$("#prdQty").val();
        data["prdbscInfoId"] = $("#prdbscInfoId").val();
        data["removeFlag"] = $("#removeFlag").val();
        data["rcCstBscInfoId"] = rcCstBscInfoId;
        data["splMfrId"] = $("#splMfrId").ligerComboBox().getValue();
        data["splMfrNm"] = $("#splMfrId").val();
        data["prdTypCd"] = prdTypCd;
        var accNoArr = [];
        var accNo1 = {};
        accNo1.splAccNoId=$("#splAccNoId").ligerComboBox().getValue();
        accNo1.purpCd = 1;
        accNoArr.push(accNo1);
        var  backNo = $("#splBackBankNoId").val();
        if(backNo){
        var accNo2 = {};
        accNo2.splAccNoId=$("#splBackBankNoId").ligerComboBox().getValue();
        accNo2.purpCd = 2;
        accNoArr.push(accNo2);
        }
        data["bankAccNoList"]=JSON.stringify(accNoArr);
       data["licenseCd"]=$("#licenseCd").val();
        var url = '<%=path%>/project/prjbscinfo/addPrdAndPrdDetail.do';
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:data,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 if(msg.success == 1){
    				 wait_dialog.close();
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    					var TAB=top.mainApp.parentTab;
			            var currentTabid=TAB.getSelectedTabItemID();
			            var currFrameElement=top.$("#"+currentTabid).get(0);
						 var callback=currFrameElement.W2W.callback;
		          	  		callback();
		          	 	 top.tab.removeTabItem(currentTabid);
    			 }else{
    				 wait_dialog.close();
    				 UIUtils.alertError(msg.info);
    			 }
    		}
    	});
	}
   function getSplBankNo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var bankId='${accId}';
	    	var audStsCdList = new Array();
			//audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
			if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
			audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
			var audStsCdListArr = JSON.stringify(audStsCdList);
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr,
	            dataType:'json',
	            success: function (res) {
	                var splAccNoId = liger.get('splAccNoId');
	                splAccNoId.gridManager.loadData(res);
	                splAccNoId.clear();
	                if(bankId){
	                  splAccNoId.setValue(bankId);
	                }
	            }
	        });
   }


   var comboGrid_defaultValue2='${accId}';
   var comboGrid_defaultText2 = '${accNo}';
   var isInit_setSearchComboVal2 = false;
  var COMBO_BANK = $("#splAccNoId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'accNo',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getBankNoGridOptions(true),
      delayLoadGrid: false
  });

  function getBankNoGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '收款人', name: 'rcptUnt',
          		render: function (rowdata, rowindex, value, column) {
           		 value ==null?"":value;
           		var h = '';
           		if(rowdata.audStsCd){
           		  if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
	                    	h+='<i class="ico_flasher"></i>';
	                 }
           		}
                   h+=value;
                       return h;
           	},
            	  minWidth: 150 },
              { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50 },
              { display: '收款账号', name: 'accNo', minWidth: 100 },
              { display: '开户银行', name: 'bkNm', minWidth: 150 },
              { display: '开户行号', name: 'bkNo', minWidth: 50 },

          ],
          switchPageSizeApplyComboBox: false,
          //url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId=splId&&audStsCd='+FlowConstant.FLOW_CHECK_STATE_PASS+'&&purpCd=1',
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue2 == "") return false;
              var defaultItems = comboGrid_defaultValue2.split(";");
              if(!isInit_setSearchComboVal2) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_BANK.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal2) { //只在初始化时执行一次，在onAfterShowData后改变
              	COMBO_BANK.setInputValue(comboGrid_defaultValue2, comboGrid_defaultText2, true);
                  isInit_setSearchComboVal2 = true;
              }
          }
      };
      return options;
  }




  //供应商返利账号
   function getSplBackBankNo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var backAccId='${backAccId}';
	    	var audStsCdList = new Array();
			if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
			audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
			var audStsCdListArr = JSON.stringify(audStsCdList);
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr+'&&purpCd=2',
	            dataType:'json',
	            success: function (res) {
	                var splBackBankNoId = liger.get('splBackBankNoId');
	                splBackBankNoId.gridManager.loadData(res);
	                splBackBankNoId.clear();
	                if(backAccId){
	                	splBackBankNoId.setValue(backAccId);
	                }
	            }
	        });
   }
   var comboGrid_defaultValue3='${backAccId}';
   var comboGrid_defaultText3 = '${backAccNo}';
   var isInit_setSearchComboVal3 = false;
  var COMBO_BACK_BANK = $("#splBackBankNoId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'accNo',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getBankNoGridOptions(true),
      delayLoadGrid: false
  });

  function getBankNoGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '收款人', name: 'rcptUnt',
          		render: function (rowdata, rowindex, value, column) {
           		 value ==null?"":value;
           		var h = '';
           		if(rowdata.audStsCd){
           		  if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
	                    	h+='<i class="ico_flasher"></i>';
	                 }
           		}
                   h+=value;
                       return h;
           	},
            	  minWidth: 150 },
              { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50 },
              { display: '收款账号', name: 'accNo', minWidth: 100 },
              { display: '开户银行', name: 'bkNm', minWidth: 150 },
              { display: '开户行号', name: 'bkNo', minWidth: 50 },

          ],
          switchPageSizeApplyComboBox: false,
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue3 == "") return false;
              var defaultItems = comboGrid_defaultValue3.split(";");
              if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_BACK_BANK.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
              	COMBO_BANK.setInputValue(comboGrid_defaultValue3, comboGrid_defaultText3, true);
                  isInit_setSearchComboVal3 = true;
              }
          }
      };
      return options;
  }





  //供应商厂商信息
   function getSplMfrInfo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var splMfrId='${splMfrId}';
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplMfrBySplId.do?splId='+splId,
	            dataType:'json',
	            success: function (res) {
	                var prjPrdSplMfrId = liger.get('splMfrId');
	                prjPrdSplMfrId.gridManager.loadData(res);
	                prjPrdSplMfrId.clear();
	                if(splMfrId){
	                	prjPrdSplMfrId.setValue(splMfrId);
	                }
	            }
	        });
   }
   var comboGrid_defaultValue4='${splMfrId}';
   var comboGrid_defaultText4 = '${splMfrNm}';
   var isInit_setSearchComboVal4 = false;
  var COMBO_SPL_MFR = $("#splMfrId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'mfrNm',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getSplMfrGridOptions(true),
      delayLoadGrid: false
  });

  function getSplMfrGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '厂商名称', name: 'mfrNm', minWidth: 200 },

          ],
          switchPageSizeApplyComboBox: false,
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue4 == "") return false;
              var defaultItems = comboGrid_defaultValue4.split(";");
              if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_SPL_MFR.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
            	  COMBO_SPL_MFR.setInputValue(comboGrid_defaultValue4, comboGrid_defaultText4, true);
                  isInit_setSearchComboVal4 = true;
              }
          }
      };
      return options;
  }




  function setSplBackBankShow(){
  	var isBckNo = $("#isBckNo").val();
  	if(isBckNo=='1'){
  		 $("#splBckBankAccDiv").show();
  	}
  	if(isBckNo=='0'){
  		 $("#splBckBankAccDiv").hide();
  	}
  }

function getSplAccNos(){
	getSplBankNo();
	getSplBackBankNo();
	getSplMfrInfo();
}

</script>
<div class="ClearLine"></div>
</body>
</html>
